package com.libre.view.file;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Side;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;

public class QrTab {

    public GridPane getGridPane(){
        GridPane gridPane = new GridPane();
        //水平和垂直间距
        gridPane.setHgap(10);
        gridPane.setVgap(10);
        // 图片
        ImageView imageView = new ImageView( "./seal/印章.png");
        imageView.setFitWidth(250);
        imageView.setFitHeight(250);
        gridPane.add(imageView, 0, 2,2,1);

        // 内容
        Label content = new Label("内容:");
        gridPane.add(content, 0, 3);
        TextField textField = new TextField();
        textField.setPromptText("建议输入20字以内");
        gridPane.add(textField, 1, 3);

        // 选项卡
        HBox hBox = new HBox();
        ToggleGroup group1 = new ToggleGroup();
        RadioButton button1 = new RadioButton("二维码");
        button1.setToggleGroup(group1);
        button1.setSelected(true);
        RadioButton button2 = new RadioButton("条形码");
        button2.setToggleGroup(group1);
        hBox.getChildren().addAll(button1,button2 );
        gridPane.add(hBox, 0, 4,2,1);
        // 生成
        Button button = new Button("生成");
        gridPane.add(button, 1, 10,2,1); //监听Tab切换

        return gridPane;
    }
}
